package com.demo.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/9/11 8:33
 */
@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Computer {
    @Autowired
    @Qualifier("intelCPU")
    // private properties
    private CPU cpu  ;
    @Autowired
    private Screen screen  ;

    // constructors
    public static Computer getInstance(CPU cpu, Screen screen) {
        return new Computer(cpu, screen) ;
    }
    public static Computer getInstance() {

        return new Computer(new IntelCPU(), new XiaomiScreen()) ;
    }



}
